#include					"Map.hh"

Map::Map(sf::RenderWindow &win)
	: _window(win)
{
	_text.loadFromFile("images/goban.png");
	_sprite.setTexture(_text);
	_sprite.setPosition(sf::Vector2f(50, 50));
	_sprite.setScale(sf::Vector2f(0.45, 0.45));
	buildMap();
}


Map::~Map()
{


}

void						Map::buildMap()
{	
	for (int y = 80; y <= 900; y += 47)
		for (int x = 80; x <= 900; x += 47)
			_map.push_back(new Square(x, y));
}

void						Map::drawMap()
{
	_window.draw(_sprite);
	for (std::vector<Square*>::iterator it = _map.begin(); it != _map.end(); ++it)
		_window.draw((*it)->_point);
}

std::vector<Square*>		Map::getMap()
{
	return (_map);
}